FROM node:12.10-alpine as build-app

WORKDIR /app
COPY . .

#RUN npm install && npm run build
RUN node -v
RUN npm i yarn tyarn -g
RUN tyarn -v
RUN tyarn
RUN tyarn build

### final image
FROM nginx:alpine

COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY --from=build-app /app/dist /usr/share/nginx/html